import request from '@/utils/request'

export function getListApi(data) {
  return request({
    url: '/course/pageInfo',
    method: 'post',
    data
  })
}

export function saveApi(data) {
  return request({
    url: '/course/save',
    method: 'post',
    data
  })
}

export function changeStateApi(data) {
  return request({
    url: '/course/changeState',
    method: 'post',
    data
  })
}

export function deleteApi(data) {
  return request({
    url: '/course/batchDelete',
    method: 'post',
    data
  })
}

export function getDetailApi(id) {
  return request({
    url: `/course/detail/${id}`,
    method: 'post',
  })
}

export function gettypeListApi(data) {
  return request({
    url: '/courseType/pageInfo',
    method: 'post',
    data
  })
}

export function getChildrenApi(id) {
  return request({
    url: `/courseType/getChildren/${id}`,
    method: 'post',
  })
}

export function saveTypeApi(data) {
  return request({
    url: '/courseType/save',
    method: 'post',
    data
  })
}

export function changeTypeStateApi(data) {
  return request({
    url: '/courseType/changeState',
    method: 'post',
    data
  })
}

export function getTypeDetailApi(id) {
  return request({
    url: `/courseType/detail/${id}`,
    method: 'post',
  })
}

export function deleteTypeApi(data) {
  return request({
    url: '/courseType/batchDelete',
    method: 'post',
    data
  })
}

export function getTypeListById(id) {
  return request({
    url: `/courseType/getChildren/${id}`,
    method: 'post',
  })
}

export function getCourseListApi(data) {
  return request({
    url: '/course/pageInfo',
    method: 'post',
    data
  })
}